//
//  NSDecimalNumber+MyDecimal.h
//  CoinEgg_App
//
//  Created by tjl on 2017/12/6.
//  Copyright © 2017年 tjl. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, calculationType) {
    Add,
    Subtract,
    Multiply,
    Divide
};

@interface NSDecimalNumber (MyDecimal)

+(NSDecimalNumber *)aDecimalNumberWithStringOrNumberOrDecimalNumber:(id)stringOrNumber1 type:(calculationType)type anotherDecimalNumberWithStringOrNumberOrDecimalNumber:(id)stringOrNumber2 andDecimalNumberHandler:(NSDecimalNumberHandler *)handler;

+(NSComparisonResult)aDecimalNumberWithStringOrNumberOrDecimalNumber:(id)stringOrNumber1 compareAnotherDecimalNumberWithStringOrNumberOrDecimalNumber:(id)stringOrNumber2;
+(NSString *)stringWithDecimalNumber:(NSDecimalNumber *)str1 scale:(NSInteger)scale;

extern NSComparisonResult StrNumCompare(id str1,id str2);

extern NSDecimalNumber *handlerDecimalNumber(id strOrNum,NSRoundingMode mode,int scale);


extern NSComparisonResult GetCompare(id strOrNum1,id strOrNum2);


extern NSDecimalNumber *GetAdd(id strOrNum1,id strOrNum2);
extern NSDecimalNumber *GetSub(id strOrNum1,id strOrNum2);
extern NSDecimalNumber *GetMul(id strOrNum1,id strOrNum2);
extern NSDecimalNumber *GetDiv(id strOrNum1,id strOrNum2);


extern NSDecimalNumber *GetMin(id strOrNum1,id strOrNum2);
extern NSDecimalNumber *GetMax(id strOrNum1,id strOrNum2);


extern NSDecimalNumber *GetAdd_handler(id strOrNum1,id strOrNum2,NSRoundingMode mode,int scale);
extern NSDecimalNumber *GetSub_handler(id strOrNum1,id strOrNum2,NSRoundingMode mode,int scale);
extern NSDecimalNumber *GetMul_handler(id strOrNum1,id strOrNum2,NSRoundingMode mode,int scale);
extern NSDecimalNumber *GetDiv_handler(id strOrNum1,id strOrNum2,NSRoundingMode mode,int scale);


extern NSDecimalNumber *GetMin_handler(id strOrNum1,id strOrNum2,NSRoundingMode mode,int scale);
extern NSDecimalNumber *GetMax_handler(id strOrNum1,id strOrNum2,NSRoundingMode mode,int scale);


@end
